<template>
	<div>
		<Model v-bind:taskId="taskId" v-bind:userId="userId" ></Model>
		<div class="container">
        <!-- 审批信息 -->
        <div class="info-preview">
            <div class="h5-list-address content">
                <div class="h5-list-flex">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-address.png"></div>
                    	房产地址：
                </div>
                <div class="white h5-address">{{changeNameInfo.roomName}}</div>
            </div>
            <div class="h5-list-flex content h5-height-default h5-user-info border-top-bottom-green">
                <div class="item left-item border-right-green">
                    <div class="font12"><img src="../../assets/images/title-user.png">发起人</div>
                    <div class="white" v-if="businessType==6">{{changeNameInfo.actCreateName}}</div>
                    <div class="white" v-if="businessType==11">{{changeNameInfo.createNameStr}}</div>
                </div>
                <div class="item center-item border-right-green">
                    <div class="font12"><img src="../../assets/images/title-user.png">经纪人</div>
                    <div class="white">{{changeNameInfo.userName}}</div>
                </div>
                <div class="item right-item">
                    <div class="font12"><img src="../../assets/images/title-user.png">客户姓名</div>
                    <div class="white">{{changeNameInfo.customerName}}</div>
                </div>
            </div>
            <div class="content">
                <div class="h5-list-flex h5-apply-time">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-time.png"></div>
                    <div>申请时间：{{changeNameInfo.tcCreateTime}}</div>
                </div>
            </div>
        </div>
        <div class="h5-list border-top-bottom-default">
            <div class="h5-list-box">
                <div class="h5-list-flex h5-list-title border-bottom-primary green">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-apply.png"></div>
                    		申请原因
                </div>
                <div class="content">
                    <div class="h5-item-txt">
						{{changeNameInfo.remark}}                    	
                    </div>
                </div>
            </div>
        </div>
        <div class="h5-list border-top-bottom-default">
            <div class="h5-list-box">
                <div class="h5-list-flex h5-list-title border-bottom-primary green">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-house.png"></div>
                    	房产信息
                </div>
                <div class="content">
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">房&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;产：</div>
                        <div class="h5-item-content">{{changeNameInfo.roomName}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">合同编号：</div>
                        <div class="h5-item-content" v-if="businessType==6">{{changeNameInfo.signCode}}</div>
                        <div class="h5-item-content" v-if="businessType==11">{{changeNameInfo.subscribeCode}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">业务类型：</div>
                        <div class="h5-item-content" v-if="businessType==6">签约</div>
                        <div class="h5-item-content" v-if="businessType==11">认购</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">计价面积：</div>
                        <div class="h5-item-content">{{changeNameInfo.calculateArea}}m2</div>
                    </div>
                </div>
            </div>
            <div class="h5-list-box">
                <div class="h5-list-flex h5-list-title border-bottom-primary h5-title-height-md orange">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-sign-info-default.png"></div>
                    <div v-if="businessType==11">认购信息</div>
                    <div v-if="businessType==6">签约信息</div>
                </div>
                <div class="content">
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">折前单价：</div>
                        <div class="h5-item-content">{{changeNameInfo.conversionPrice}}元</div>
                    </div>
                    <div class="h5-list-flex h5-height-default">
                        <div class="h5-item-label">折前总价：</div>
                        <div class="h5-item-content">{{changeNameInfo.lumpsumPrice}}元</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="h5-list border-top-bottom-default">
            <div class="h5-list-box">
                <div class="h5-list-flex h5-list-title border-bottom-primary green">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-user-info.png"></div>
                   	 原客户信息
                </div>
                <div class="content" v-for="(row,index) in fmOldList">
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">姓名：</div>
                        <div class="h5-item-content">{{row.memberName}}</div>
                    </div>
                    
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件类型：</div>
                        <div class="h5-item-content">{{row.documentType}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件号码：</div>
                        <div class="h5-item-content">{{row.documentNumber}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">手机号码：</div>
                        <div class="h5-item-content">{{row.mobile}}</div>
                    </div>
                   
                </div>
            </div>
        </div>
        <div class="h5-list border-top-bottom-default">
            <div class="h5-list-box">
                <div class="h5-list-flex h5-list-title border-bottom-primary green">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-partner.png"></div>
                   	新客户信息
                </div>
                <div class="content" v-for="(row,index) in fmNewList">
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">姓名：</div>
                        <div class="h5-item-content">{{row.memberName}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件类型：</div>
                        <div class="h5-item-content">{{row.documentType}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件号码：</div>
                        <div class="h5-item-content">{{row.documentNumber}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default">
                        <div class="h5-item-label">手机号码：</div>
                        <div class="h5-item-content">{{row.mobile}}</div>
                    </div>
                </div>
            </div>
        </div>
        
        
           <div class="h5-list border-top-bottom-default">
            <div class="h5-list-box">
                <div class="h5-list-flex h5-list-title border-bottom-primary green">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-user-info.png"></div>
                    	原共同购房者
                </div>
                <div class="content" v-for="(row,index) in fmOldTogetherList">
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">姓名：</div>
                        <div class="h5-item-content">{{row.memberName}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件类型：</div>
                        <div class="h5-item-content">{{row.documentType}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件号码：</div>
                        <div class="h5-item-content">{{row.documentNumber}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">手机号码：</div>
                        <div class="h5-item-content">{{row.mobile}}</div>
                    </div>
                </div>
            </div>
        </div>
        
            <div class="h5-list border-top-bottom-default">
            <div class="h5-list-box">
                <div class="h5-list-flex h5-list-title border-bottom-primary green">
                    <div class="h5-list-title-img"><img src="../../assets/images/title-partner.png"></div>
                   	新共同购房者
                </div>
                <div class="content" v-for="(row,index) in fmNewTogetherList">
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">姓名：</div>
                        <div class="h5-item-content">{{row.memberName}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件类型：</div>
                        <div class="h5-item-content">{{row.documentType}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">证件号码：</div>
                        <div class="h5-item-content">{{row.documentNumber}}</div>
                    </div>
                    <div class="h5-list-flex h5-height-default border-bottom-primary">
                        <div class="h5-item-label">手机号码：</div>
                        <div class="h5-item-content">{{row.mobile}}</div>
                    </div>
                </div>
            </div>
        </div>
         <!--设置单页面标题-->
	        <Document v-bind:processId="processId"></Document>
        <!-- 附件 -->
        <ActivityFile v-bind:objectId="objectId" v-bind:imageType="imageType"></ActivityFile>
        <!-- 审批进度 h-->
        <ActivityHistory v-bind:processId="processId" v-bind:userId="userId"></ActivityHistory>
    </div>
    <div class="md-overlay"></div>
    <div class="h5-btn-list">
       <a class="h5-btn h5-btn-primary md-trigger" data-modal="modal-1" style="width: 100%;">审核</a>
    </div>
		
	</div>
</template>

<script>
	import Document from '../common/document.vue'
	import ActivityFile from '../common/activityFile.vue';
	import ActivityHistory  from '../common/activityHistory.vue'
	import Model from '../common/modal.vue'
	export default{
		data(){
			return{
				changeNameInfo:{},
				fmNewList:[],
				fmNewTogetherList:[],
				fmOldList:[],
				fmOldTogetherList:[],
				imageType:'6',
				objectId:'',
				taskId:'',
				userId:'',
				processId:'',
				businessType:''
			}
		},mounted:function(){
			this.initChangeName();
		},components: {
			Model,
			ActivityFile,
			ActivityHistory,
			Document
		},
		methods:{
			initChangeName:function(){
				var _self = this;
				var busKey = _self.$route.params.busKey;
				_self.objectId = busKey;
				_self.taskId = _self.$route.params.taskId;
				_self.userId = _self.$route.params.userId;
				_self.processId = _self.$route.params.processId;
				
					var params = {
					id:busKey
				};
				var url = _self.utilHelper.apiUrl+'/wordFlowData/changeName';
				_self.$http.post(url,params).then((response)=>{
					var body = response.body;
					if(body.res=="1"){
						_self.businessType = body.obj.businessType;
						_self.changeNameInfo = body.obj.changeNameInfo;
						_self.fmOldList = body.obj.fmOldList;
						_self.fmNewList = body.obj.fmNewList;
						_self.fmNewTogetherList = body.obj.fmNewTogetherList;
						_self.fmOldTogetherList = body.obj.fmOldTogetherList;
						
					}else{
						layer.alert("接口异常,请联系管理员!");
					}
				});
			}
		}
	}
</script>

